package ToYesterday.duplicateNumbers_03;

public class SolutionByDemo {
    public int solutionBydemo(int[] nums){
        int i = 0 ;
        int temp=0;
        while (i<nums.length){
            while (i!=nums[i]){
                if (nums[nums[i]]==nums[i])return nums[i];
                temp = nums[nums[i]];
                nums[nums[i]] = nums[i];
                nums[i] = temp;
            }
            i++;
        }
        return 0;
    }
}
